package com.woniuxy;

import com.woniuxy.service.ShopService;
import com.woniuxy.tools.service.*;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

import javax.tools.Tool;

@SpringBootApplication
public class McpServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(McpServerApplication.class);
    }
    @Bean
    public ToolCallbackProvider weatherTools(WeatherService weatherService) {
        return MethodToolCallbackProvider.builder().toolObjects(weatherService).build();
    }
    @Bean
    public ToolCallbackProvider Tools(ToolService toolService){
        return MethodToolCallbackProvider.builder().toolObjects(toolService).build();
    }
    @Bean
    public ToolCallbackProvider Ranking(RunToolService runToolService){
        return MethodToolCallbackProvider.builder().toolObjects(runToolService).build();
    }
    @Bean
    public ToolCallbackProvider Img(ImgToolService imgToolService){
        return MethodToolCallbackProvider.builder().toolObjects(imgToolService).build();
    }
    @Bean
    public ToolCallbackProvider articleRanking(ToolService toolService){
        return MethodToolCallbackProvider.builder().toolObjects(toolService).build();
    }

    @Bean
    public ToolCallbackProvider Shop(ShopToolService shopToolService){
        return MethodToolCallbackProvider.builder().toolObjects(shopToolService).build();
    }
    @Bean
    public ToolCallbackProvider Order(OrderToolService orderToolService){
        return MethodToolCallbackProvider.builder().toolObjects(orderToolService).build();
    }

}
